package cn.anecansaitin.whimsy.common.capabilities;


import cn.anecansaitin.whimsy.Whimsy;
import net.neoforged.neoforge.capabilities.ItemCapability;

public interface IManaStorage {
    ItemCapability<IManaStorage, Void> MANA_STORAGE = ItemCapability.createVoid(Whimsy.resource("mana_storage"), IManaStorage.class);
    int receiveMana(String manaType, int maxReceive, boolean simulate);

    int extractMana(String manaType, int maxExtract, boolean simulate);

    int getManaStored(String manaType);

    int getMaxManaStored(String manaType);

    boolean canExtract(String manaType);

    boolean canReceive(String manaType);

    Iterable<ManaType> getAllMana();

    class ManaType {
        public final String name;
        public int mana;
        public final int capacity;
        public final int maxReceive;
        public final int maxExtract;
        public final int color;

        public ManaType(String name, int mana, int capacity, int maxReceive, int maxExtract, int color) {
            this.name = name;
            this.mana = mana;
            this.capacity = capacity;
            this.maxReceive = maxReceive;
            this.maxExtract = maxExtract;
            this.color = color;
        }
    }
}
